import React, { Component } from 'react'

export default class UserChild extends Component {
    constructor(){
        super()
        this.state = {
            msg: '蛋烘糕'
        }
    }
   
    render() {
        // console.log(this.props);
        let {age,name} = this.props;
        return (
            <div>
                <p>我是userinfo的子组件</p>
                <button onClick={()=>this.props.car(this.state.msg)}>子传父</button>
            </div>
        )
    }
}
